//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __MODULEFILE_H_
#define __MODULEFILE_H_

#include <aura.h>
#include "cgmodule.h"

typedef void *FILE;

class CLoadedFile {
public:
    CLoadedFile()
    {
        m_File = AURA_NULL;
        m_hDll = AURA_NULL;
        m_pBuffer = AURA_NULL;
    }

    ~CLoadedFile();

    Aura_ECode Init(Aura_PWChar wszFullPath);

    Aura_ECode Read(Aura_UInt32 offset, Aura_UInt32 size, Aura_PVoid *ppBuf,
                 Aura_Bool bUseInterBuf = AURA_TRUE);          

    Aura_UInt32 GetSize();
    
protected:
    FILE m_File;
    Aura_PVoid m_hDll;
    Aura_PVoid   m_pBuffer;
};

#endif  //__MODULEFILE_H_
